﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using FbKPI.Model;
using FbKPI.Controller;

namespace FbKPI.Facade
{
    public class UoMDetailFacade
    {
        public string Save(UoMDetail Details)
        {
            UoMDetailController cont = new UoMDetailController();
            return cont.Save(Details);
        }

        public string Delete(UoMDetail Details)
        {
            UoMDetailController cont = new UoMDetailController();
            return cont.Delete(Details);
        }

        public string BeforeDelete(UoMDetail Details)
        {
            UoMDetailController cont = new UoMDetailController();
            return cont.BeforeDelete(Details);
        }

        public IList<UoMDetail> GetAll(string sSearch, int PageNumber, int DataLength, string SortCol, string SortDirection, out int TotalData)
        {
            IList<UoMDetail> Details = new List<UoMDetail>();
            UoMDetailController cont = new UoMDetailController();
            Details = cont.GetAll(sSearch, PageNumber, DataLength, SortCol, SortDirection, out TotalData);
            return Details;
        }

        public IList<UoMDetail> GetAllUoMDetailsByUoMID(string sSearch, int UoMID, int PageNumber, int DataLength, string SortCol, string SortDirection, out int TotalData)
        {
            IList<UoMDetail> Details = new List<UoMDetail>();
            UoMDetailController cont = new UoMDetailController();
            Details = cont.GetAllUoMDetailsByUoMID(sSearch, UoMID, PageNumber, DataLength, SortCol, SortDirection, out TotalData);
            return Details;
        }

        public UoMDetail GetUoMDetailByID(int ID)
        {
            UoMDetail Details = new UoMDetail();
            UoMDetailController cont = new UoMDetailController();
            Details = cont.GetUoMDetailByID(ID);
            return Details;
        }

        public UoMDetail GetUoMDetailByDescription(string Description, int UOMID)
        {
            UoMDetail Details = new UoMDetail();
            UoMDetailController cont = new UoMDetailController();
            Details = cont.GetUoMDetailByDescription(Description, UOMID);
            return Details;
        }
    }
}